package com.sihan.swvp.config;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

import com.sihan.swvp.common.MD5Util;


public class ConvertPwdPropertyConfigurer extends PropertyPlaceholderConfigurer {
	@Override
	protected String convertProperty(String propertyName, String propertyValue) {

		String decodeValue=""; 
	
		if ("jdbc.username".equals(propertyName)) {
			decodeValue=MD5Util.reversibleMD5Decode(propertyValue);
			return decodeValue;
		}
		
		if("jdbc.password".equals(propertyName)){
			decodeValue=MD5Util.reversibleMD5Decode(propertyValue);
			return decodeValue;
		}
        return propertyValue;  
	}
}
